package com.wisdomparking.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.wisdomparking.service.siwo.impl.SiwoDataServiceImpl;

@Component
public class Scheduler {
	
	/**
	 * 每隔60秒同步一次数据
	 */
	@Scheduled(fixedRate = 60000)  
    public void testTasks() {
		RawDataMonitor rawDataMonitor = new RawDataMonitor();
		rawDataMonitor.dataListen();
    }
	
	/**
	 * 获取思沃时车位信息
	 */
	@Scheduled(fixedRate = 60000)  
	public void addSiwo() {
		RawDataMonitor rawDataMonitor = new RawDataMonitor();
		rawDataMonitor.addRawdataDB("8360a98200dd9bd71343ef91d7374db6", new SiwoDataServiceImpl().getGetParkingSpaces());
	}
	
}
